const  gulp = require('gulp');
const concat = require("gulp-concat");
const  uglify = require("gulp-uglify");
const  cleanCss = require("gulp-clean-css");
const htmlmin = require("gulp-htmlmin");

gulp.task('js',function(){
	return gulp.src(['js/jquery-2.0.3.js','js/unslider.min.js','js/index.js'])
	.pipe(concat('index.js'))
	.pipe(gulp.dest('./'))
	.pipe(uglify(''))
	.pipe(gulp.dest('dist'))

})

gulp.task('css',function  () {
	return gulp.src('css/style.css')
	.pipe(cleanCss('index.css'))
	.pipe(gulp.dest('dist/'))
})
gulp.task('html', function() {
  return gulp.src('index.html')
  // collapseWhitespace 是否清除空格
    .pipe(htmlmin({ collapseWhitespace: true }))
    .pipe(gulp.dest('dist/'))
})
gulp.task('resources', function() {
  return gulp.src(['images/*','login.html','register.html'], { base: './' })
    .pipe(gulp.dest('dist/'))
})